home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03020405.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  4.2 KB  |  67 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>FileAttr-Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03020405"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle1{
  5.                 }
  6.         span.Tabelle1A{
  7.                 width:1.499cm;}
  8.         span.Tabelle1B{
  9.                 width:16.498cm;}
  10.         tr.Tabelle11{
  11.                 }
  12.         td.Tabelle1A1{
  13.                 }
  14.         p.P1{
  15.                 }
  16.         p.P2{
  17.                 }
  18.         span.T1{
  19.                 font-weight:bold;}
  20.         span.fr1{
  21.                 }
  22.         </style></head><body>
  23.   
  24.   
  25.   <help:to-be-embedded Eid="fileattr" xmlns:help="http://openoffice.org/2000/help">
  26.   <p class="Head1"><help:link Id="66567">FileAttr-Function [Runtime]</help:link></p>
  27.   <p class="Paragraph">Returns the access mode or the MS-DOS file attribute of a file that was opened with the Open statement. The MS-Dos file attribute is an access number of the operating system. Therefore it is dependent on the operating system (OSH = Operating System Handle).</p>
  28.   </help:to-be-embedded>
  29.   <table><tr class="Tabelle11"><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  30.       <p class="TextInTable"><draw:image draw:style-name="fr1" draw:name="HIND_1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  31.      </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
  32.       <p class="TextInTable">If you use an operating system with a 32-Bit-Version, it will not be possible to use the FileAttr-Function to determine the MS-Dos file attribute. In this case, you will always get the value 0 as access number.</p>
  33.      </span></th></tr></table>
  34.   <p class="Paragraph"/>
  35.   <p class="Paragraph">See also: <help:link Id="66386" Eid="open" xmlns:help="http://openoffice.org/2000/help">Open</help:link></p>
  36.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  37.   <p class="Paragraph">FileAttr (FileNumber As Integer, Attribut As Integer) <help:key-word value="FileAttr" tag="kw66567_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  38.   <p class="Paragraph"><span class="T1">Return value</span>:</p>
  39.   <p class="Paragraph">Integer</p>
  40.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  41.   <p class="Paragraph">FileNumber: The number of the file opened with the Open statement.</p>
  42.   <p class="Paragraph">Attribute: Integer expression that indicates the type of file information to return. The following values are possible:</p>
  43.   <p class="Paragraph">1: The FileAttr-Function indicates the access mode of the file.</p>
  44.   <p class="Paragraph">2: The FileAttr-Function returns the file access number of the operating system.</p>
  45.   <p class="Paragraph">If you specify a parameter attribute with the value 1, you will get the following return values:</p>
  46.   <p class="Paragraph">1 - INPUT (file open for input)</p>
  47.   <p class="Paragraph">2 - OUTPUT (file open for output)</p>
  48.   <p class="Paragraph">4 - RANDOM (file open for random access)</p>
  49.   <p class="Paragraph">8 - APPEND (file open for appending)</p>
  50.   <p class="Paragraph">32 - BINARY (file open in binary mode).</p>
  51.   <p class="P2">Example:</p>
  52.   <p class="PropText">Sub ExampleFileAttr</p>
  53.   <p class="PropText">Dim iNumber As Integer</p>
  54.   <p class="PropText">Dim sLine As String</p>
  55.   <p class="PropText">Dim aFile As String</p>
  56.   <p class="PropText">aFile = "c:\data.txt"</p>
  57.   <p class="PropText"/>
  58.   <p class="PropText">iNumber = Freefile</p>
  59.   <p class="PropText">Open aFile For Output As #iNumber</p>
  60.   <p class="PropText">Print #iNumber, "This is a line of text"</p>
  61.   <p class="PropText">MsgBox FileAttr(#iNumber, 1 ),0,"Access mode"</p>
  62.   <p class="PropText">MsgBox FileAttr(#iNumber, 2 ),0,"File attribute"</p>
  63.   <p class="PropText">Close #iNumber</p>
  64.   <p class="PropText">End Sub</p>
  65.   <p class="PropText"/>
  66.   <p class="PropText"/>
  67.  </body></html>